<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt'%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page
	import="org.springframework.security.core.AuthenticationException"%>
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="utf-8" />
<style type="text/css">
.promoteZ {
	z-index: 20036 !important; /* Dialog z-index is 1006*/
}
</style>


<style type="text/css">
</style>
<title>Login</title>

<link rel="stylesheet" type="text/css"
	href=${pageContext.servletContext.contextPath}/static/css/logreg-style.css />
<link rel="stylesheet" type="text/css"
	href=${pageContext.servletContext.contextPath}/static/css/logreg-form.css />
<link rel="stylesheet" type="text/css"
	href=${pageContext.servletContext.contextPath}/static/css/jquery-ui-1.8.14.custom.css />
<script type="text/javascript"
	src=${pageContext.servletContext.contextPath}/static/javascript/jquery-1.6.2.min.js></script>
<script type="text/javascript"
	src=${pageContext.servletContext.contextPath}/static/javascript/jquery-1.6.2.min.js></script>
<script type="text/javascript"
	src=${pageContext.servletContext.contextPath}/static/javascript/jquery-ui-1.8.16.custom.min.js></script>
<script type="text/javascript"
	src=${pageContext.servletContext.contextPath}/static/javascript/jquery.validate-1.5.5.min.js></script>

<script type="text/javascript">

	$(document)
			.ready(											
					function() {
						
							$("div#panel").animate({
								height : "500px"
							}).animate({
								height : "390px"
							}, "fast");


						$("div#hide_button").click(function() {
							$("div#panel").animate({
								height : "0px"
							}, "fast");

						});
						
						if(${not empty param.login_error}){
							$("div#panel").css("height","390px");
						}
						
						$( "#dateOfBirth" ).datepicker({ minDate: "-100Y", maxDate: "-18Y",changeMonth: true,
							changeYear: true,showOn: 'focus'});
					});
	
	
	function submitForm(){

		$("form").submit();
			$("#username").validate({
				   rules: {
				     // simple rule, converted to {required:true}
				     username: "required",
				     // compound rule

				   }
				})
		
	}
	
	</script>
</head>
<body>
	<div id="header">
		<h1>Wypozyczalnia samochodow</h1>
	</div>
	<hr id="header_stripe" />
	<div id="page_container">
		<div id="toppanel">
			<div id="panel">
				<div id="panel_contents"></div>
				<h2></h2>
				<div>
					<form:form class="cmxform" commandName="registerForm"
						id="registerForm" method="post" action="saveUser.do"
						onSubmit="submitForm(); return false;">
						<fieldset>
							<legend>Rejestracja</legend>
							<form:label styleClass="imie" path="username">Login</form:label>
							<form:input path="username" required="required" />
							<form:label path="pass">Haslo</form:label>
							<form:password path="pass" required="required" />
							<form:label path="name">Imie</form:label>
							<form:input path="name" required="required" />
							<form:label path="secondName">Nazwisko</form:label>
							<form:input path="secondName" required="required" />
							<form:label path="email">Email</form:label>
							<form:input path="email" type="email" required="required" />
							<form:label path="phone">Telefon</form:label>
							<form:input path="phone"
								onkeyup="this.value=this.value.replace(/\D/g,'')"
								required="required" number="true" maxlength="9" />
							<form:label path="dateOfBirth">Data urodzenia</form:label>
							<form:input path="dateOfBirth" id="dateOfBirth"
								required="required" />
							<label style="color: red;">${message}</label><input type="submit"
								value="Zarejestruj" />
						</fieldset>

					</form:form>
				</div>
			</div>
		<div class="panel_button" style="display: visible;">
		<a href="login.do">	<img src="static/images/back_button.png" alt="logownie" /> Logowaie</a>
		</div>

		</div>
		<div id="masthead"
			style="background: url('static/images/images1.jpg') no-repeat; height: 400px; margin: 20px 0;">
		</div>

		<div id="footer">
			<p>i to wszystko na razie jesli chodzi o te strone :)</p>
		</div>
	</div>
</body>
</html>


